/*
 * ThreadKeepCharged.h
 *
 *  Created on: Jan 27, 2013
 *      Author: Drew Prevost
 */

#ifndef THREADKEEPCHARGED_H_
#define THREADKEEPCHARGED_H_

#include <Protothread.h>
#include "Arduino.h"
#include "ThreadVoltageMonitor.h"
#include "ThreadEngineStart.h"
#include "ThreadEngineStop.h"
#include "ThreadServoRate.h"

class ThreadKeepCharged: public Protothread
{
public:
  ThreadKeepCharged(
                     uint8_t nVmPin,
                     int nVmPinMin,
                     int nVmPinMax,
                     int nVmVoltsMin,
                     int nVmVoltsMax,
                     unsigned long nVmReadFreqMicros,
                     uint8_t nEngServoPin,
                     unsigned long nEngServoMaxSpeedInMicrosPerDegree,
                     unsigned int nEngServoInitialPosition,
                     uint8_t nEngPinGlowPlug,
                     uint8_t nEngPinGenConnect,
                     uint8_t nEngPinStarterMotor,
                     uint8_t nEngPinGenDisonnect,
                     uint8_t nEngPinGenMonitor );
  virtual ~ThreadKeepCharged();

  virtual bool run();

protected:
  ThreadVoltageMonitor threadVoltageMonitor;
  ThreadServoRate threadServoEngineExhaust;
  ThreadEngineStart threadEngineStart;
  ThreadEngineStop threadEngineStop;
};

#endif /* THREADKEEPCHARGED_H_ */
